package cn.iocoder.yudao.module.member.dal.mysql.jobintention;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.member.dal.dataobject.jobintention.JobIntentionDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.member.controller.admin.jobintention.vo.*;

/**
 * 用户求职意向 Mapper
 *
 * @author Alan
 */
@Mapper
public interface JobIntentionMapper extends BaseMapperX<JobIntentionDO> {

    default PageResult<JobIntentionDO> selectPage(JobIntentionPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<JobIntentionDO>()
                .eqIfPresent(JobIntentionDO::getUserId, reqVO.getUserId())
                .eqIfPresent(JobIntentionDO::getMajorId, reqVO.getMajorId())
                .likeIfPresent(JobIntentionDO::getCityName, reqVO.getCityName())
                .eqIfPresent(JobIntentionDO::getCityCode, reqVO.getCityCode())
                .eqIfPresent(JobIntentionDO::getJobType, reqVO.getJobType())
                .eqIfPresent(JobIntentionDO::getEducationalBackground, reqVO.getEducationalBackground())
                .eqIfPresent(JobIntentionDO::getEnterpriseNature, reqVO.getEnterpriseNature())
                .likeIfPresent(JobIntentionDO::getMajorName, reqVO.getMajorName())
                .betweenIfPresent(JobIntentionDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(JobIntentionDO::getId));
    }

}